#objs = main.o start.o
objs = start.o main.o 

ledc.bin : $(objs)
	#arm-linux-gnueabihf-ld -Ttext 0x87800000 $^ -o ledc.elf
	arm-linux-gnueabihf-ld -Timx6ul.lds -o ledc.elf $^
	arm-linux-gnueabihf-objcopy -O binary -S ledc.elf $@
	arm-linux-gnueabihf-objdump -D ledc.elf -m arm > ledc.dis


%.o : %.c
	arm-linux-gnueabihf-gcc -c -Wall -nostdlib -o $@ $<

%.o : %.s 
	arm-linux-gnueabihf-gcc -c -Wall -nostdlib -o $@ $<

clean:
	rm -rf *.o ledc.elf ledc.bin ledc.dis
	rm -rf load.imx

